<?php

use yii\grid\GridView;
use common\helpers\Html;
use common\helpers\Url;
use common\helpers\ImageHelper;
use common\models\bonus\Bonus;

$this->title = '会员当天记录'.date('Y/m/d', $day);
$this->params['breadcrumbs'][] = ['label' => '会员每天汇总', 'url' => ['day-list', 'day'=>$day]];
$this->params['breadcrumbs'][] = ['label' => '每天汇总', 'url' => ['day-list']];
$this->params['breadcrumbs'][] = ['label' => $this->title];

?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-body table-responsive">
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'filterModel' => $searchModel,
                    //重新定义分页样式
                    'tableOptions' => ['class' => 'table table-hover rf-table'],
                    'columns' => [
                        [
                            'class' => 'yii\grid\SerialColumn',
                            'visible' => false, // 不显示#
                        ],
                        [
                            'header' => '日期',
                            'attribute' => 'created_at',
                            'filter' => false, //不显示搜索框
                            'format' => ['date', 'php:Y-m-d'],
                        ],
                        [
                            'attribute' => 'member_id',
                            'value' => 'member.username',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'bonus_type',
                            'value' => 'bonusTypeName',
                            'filter' => Bonus::$typeArr, //不显示搜索框
                        ],
                        [
                            'attribute' => 'from_member_id',
                            'value' => 'fromMember.username',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'amount',
                            'filter' => false, //不显示搜索框
                        ],
                        [
                            'attribute' => 'created_at',
                            'filter' => false, //不显示搜索框
                            'format' => ['date', 'php:Y-m-d H:i:s'],
                        ],
                        [
                            'attribute' => 'status',
                            'value' => 'statusName',
                            'filter' => Bonus::$statusArr, //不显示搜索框
                        ],
                        [
                            'attribute' => 'pay_at',
                            'filter' => false, //不显示搜索框
                            'format' => ['date', 'php:Y-m-d H:i:s'],
                        ],
                        // [
                        //     'attribute' => 'fx',
                        //     'filter' => false, //不显示搜索框
                        // ],
                        // [
                        //     'attribute' => 'jj',
                        //     'filter' => false, //不显示搜索框
                        // ],
                        // [
                        //     'attribute' => 'glf',
                        //     'filter' => false, //不显示搜索框
                        // ],
                        // [
                        //     'attribute' => 'tx',
                        //     'filter' => false, //不显示搜索框
                        // ],
                        // [
                        //     'attribute' => 'payment',
                        //     'filter' => false, //不显示搜索框
                        // ],
                        // [
                        //     'attribute' => 'bonus_6',
                        //     'filter' => false, //不显示搜索框
                        // ],
                        // [
                        //     'attribute' => 'bonus_all',
                        //     'filter' => false, //不显示搜索框
                        // ],
                        // [
                        //     'attribute' => 'bonus_all',
                        //     'filter' => false, //不显示搜索框
                        //     'value' => function($model){
                        //         return $sum = $model->bonus_2 + $model->bonus_3;
                        //     }
                        // ],
                    ],
                ]); ?>
            </div>
        </div>
    </div>